<%@ page import="cn.edu.ujn.shi.dao.User" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="header-admin.jsp" %>
<center><img src='images/用户.png' height=70px><font size='+4' face='楷体' color='#7D26CD'><b>用户账号管理</b></font>
</center>
<hr/>
<center>
    <form action="AListUserServlet" method="get">
        <label for="username">按用户名搜索：</label>
        <input type="text" id="username" name="username">
        <button type="submit">搜索</button>
    </form>
    <table border=1 width=80%>
        <tr bgcolor='#E0EEE0'>
            <td><b>用户名</b></td>
            <td><b>密码</b></td>
            <td><b>真实姓名</b></td>
            <td><b>年龄</b></td>
            <td><b>联系方式</b></td>
            <td><b>身份证号</b></td>
            <td><b>用户类型</b></td>
            <td><b>操作</b></td>
        </tr>
        <%
            List<User> list = (List<User>) request.getAttribute("list");
            for (int i = 0; i < list.size(); i++) {
                User u = list.get(i);
                out.println("<tr>");
                out.println("<td>");
                out.println(u.getUsername());
                out.println("</td>");
                out.println("<td>");
                out.println(u.getUserpass());
                out.println("</td>");
                out.println("<td>");
                out.println(u.getTruename());
                out.println("</td>");
                out.println("<td>");
                out.println(u.getAge());
                out.println("</td>");
                out.println("<td>");
                out.println(u.getTel());
                out.println("</td>");
                out.println("<td>");
                out.println(u.getCardnumber());
                out.println("</td>");
                out.println("<td>");
                out.println(u.getType());
                out.println("</td>");
                out.println("<td>");
                out.println("<a href='DeleteUserServlet?username=" + u.getUsername() + "'>删除非法用户</a>");
                out.println("</td>");
                out.println("</tr>");
            }
        %>
    </table>
</center>
<nav aria-label="Page navigation">
    <ul class="pagination">
        <a href="?page=1">首页</a></li>
        <a href="?page=1">上一页</a></li>
        1 <a href="?page=1>">下一页</a></li>
        <a href="?page=1>">尾页</a></li>
    </ul>
</nav>
<%@ include file="footer.jsp" %>